﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;

namespace ALinq.BBS.Common.Config
{
    public class EmailElement : ConfigurationElement
    {
        [ConfigurationProperty("host")]
        public string SmtpHost
        {
            get
            {
                return (string) base["host"];
            }
            set
            {
                base["host"] = value;
            }
        }

        /// <summary>
        /// SMTP服务器端口。
        /// </summary>
        [ConfigurationProperty("port")]
        public int SmtpPort
        {
            get
            {
                return (int) base["port"];
            }
            set
            {
                base["port"] = value;
            }
        }

        /// <summary>
        /// SMTP登录用户名。
        /// </summary>
        [ConfigurationProperty("account")]
        public string SmtpUserName
        {
            get { return (string)base["account"]; }
            set { base["account"] = value; }
        }

        /// <summary>
        /// SMTP登录密码。
        /// </summary>
        [ConfigurationProperty("password")]
        public string SmtpPassword
        {
            get { return (string) base["password"]; }
            set { base["password"] = value; }
        }

        [ConfigurationProperty("auth",DefaultValue = true)]
        public bool SmtpAuth
        {
            get { return (bool) base["auth"]; }
            set { base["auth"] = value; }
        }

        /// <summary>
        /// 发件人邮箱
        /// </summary>
        [ConfigurationProperty("email")]
        public string SmtpEmail
        {
            get { return (string) base["email"]; }
            set { base["email"] = value; }
        }

        /// <summary>
        /// 发件人名称
        /// </summary>
        [ConfigurationProperty("name")]
        public string SmtpName
        {
            get { return (string) base["name"]; }
            set { base["name"] = value; }
        }
    }
}
